#include <iostream>
#include <cstring>
using namespace std;

int fun(int lowerBound, int upperBound);

int main(){
	int lowerBound;
	int upperBound;
	cin >> lowerBound >> upperBound;
	cout << fun(lowerBound, upperBound) << endl;
}

int fun(int lowerBound, int upperBound){
	int * list = new int[10];
	memset(list, 0, 10 * sizeof(int));
	for(int i = lowerBound; i <= upperBound; i++){
		int key = i;
		while(key){
			list[key % 10]++;
			key = key / 10;
		}
	}
	return list[2];
}
